package prototype.economy.jpk;

import java.util.HashSet;

public class ItemDB {
  private final static ItemDB INSTANCE  = new ItemDB();
  
  private final HashSet<Item> items;
  
  private ItemDB() {
    this.items = new HashSet<Item>();
    this.items.add(new Item("Wurstsalat", 1));
    this.items.add(new Item("Bierschinken", 2));
    this.items.add(new Item("Tasse", 3));
  };
  
  public static ItemDB getInstance() {
    return INSTANCE;
  }

  public HashSet<Item> getItems() {
    return items;
  }
  
  public Item getItem(int id) {
    for (Item item : getItems()) {
      if (item.getId() == id) return item;
    }
    return null;
  }
  
}